package com.example.mapper;

import com.example.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 资源表 Mapper 接口
 * </p>
 *
 * @author sword
 * @since 2021-03-26
 */
public interface PermissionMapper extends BaseMapper<Permission> {
    @Select("select p.* from permission p,role_permission rp where p.id=rp.permission_id and rp.role_id=#{id}")
    List<Permission> findPermissionByRole(@Param("id") Integer id);
}
